package com.weijianhuawen.wjblog.admin.runner;

import com.weijianhuawen.wjblog.admin.service.AdminStatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-11-08 15:19
 */

@Component
@Slf4j
public class StatisticsTagArticleTotalRunner implements CommandLineRunner {
    @Autowired
    private AdminStatisticsService adminStatisticsService;
    @Override
    public void run(String... args) throws Exception {
        // 统计所有标签下的文章总数
        log.info("【项目就绪前】 开始统计标签下的文章数！");
        adminStatisticsService.statisticsTagArticleTotal();
        log.info("【项目就绪前】 各标签下的文章数统计完毕！");
    }
}
